﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using BrokerBase.Lib.Policy;
using BrokerBase.Lib.Product;
using BrokerBase.Lib.Tool;
using System.ComponentModel;
using Telerik.Windows.Controls;
using System.Windows;

namespace Broker.View.PolicyView
{
    
    public delegate void PolicyChangedHandler(IPolicyLight policyLight);

    public class PolicyBaseControl:UserControl
    {
        public event PolicyChangedHandler PolicyChanged;
       
        private IPolicyLight policyLight;

        public PolicyBaseControl():base()
        {

        }

        public PolicyBaseControl(IPolicyLight pl):this()
        {
            this.policyLight = pl;
        }

        public IPolicyLight PolicyLight { get { return this.policyLight; } }

        public virtual bool Verify()
        {
            return false;
        }

        public virtual void OnPolicyChanged()
        {
            

            if (PolicyChanged != null)
            {
                PolicyChanged(this.policyLight);
            }
        }

        public virtual void ClearData()
        {
        }

        public virtual void SetControlState()
        {

        }

    }
}
